//
//  QuotesTopCell.m
//  CBT
//
//  Created by 四点钟 on 2018/11/17.
//  Copyright © 2018 Mr.Zhang. All rights reserved.
//

#import "QuotesTopCell.h"
#import <SDWebImage/UIImageView+WebCache.h>

@interface QuotesTopCell()

@property (weak, nonatomic) IBOutlet UILabel *coinSymbolLabel;
@property (weak, nonatomic) IBOutlet UILabel *coinPriceLabel;
@property (weak, nonatomic) IBOutlet UILabel *fluctuationLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UIImageView *roundIconImageView;
@property (weak, nonatomic) IBOutlet UIButton *rightIconImageView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *coinSymboWidthCon;

@end

@implementation QuotesTopCell

- (void)awakeFromNib {
    [super awakeFromNib];

}

-(void)setModel:(QuotesItemModel *)model
{
    self.coinSymbolLabel.text  = model.coinSymbol;
    self.coinPriceLabel.text   = model.coinPrice;
    self.fluctuationLabel.text = model.fluctuation;
    self.fluctuationLabel.textColor = [model.fluctuationState intValue] == 1 ? UIColorFromRGB(0x45b70d):UIColorFromRGB(0xff4444);
    
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",kBaseURL_PICSTATIC,model.coinPictureURL]] placeholderImage:[UIImage imageNamed:@"image_placeholder"]];
    
    [self.rightIconImageView setImage:[UIImage imageNamed:([model.fluctuationState intValue] == 1 ? @"hangqing_up" : @"hangqing_down")] forState:(UIControlStateNormal)];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
